#! /bin/bash
num=(1 2 3 4 5 6 7)
#echo "${num[@]}"

array(){
	fact=1
	for i in "$@"
	do
		fact=$[$fact*$i]
	done
	echo "$fact"
}

result=`array ${num[@]}`
echo "$result"
